---
title: "Web-OLOGRAM"
output:
flexdashboard::flex_dashboard:
source_code: embed
orientaion: columns
theme: bootstrap
params:
barplot_table: NULL
volcano_table: NULL
---
```{css}
.chart-shim {
overflow: auto;
}
```
```{r global, include = FALSE}
knitr::opts_chunk$set(echo = FALSE)
#--------------------------------------------------------------
# Load libraries
#--------------------------------------------------------------
# library(shiny)
library(reshape2)
library(ggplot2)
library(dplyr)
library(ggrepel)
library(ggthemes)
library(shinythemes)
library(optparse)
library(plotly)
library(DT)
library(crosstalk)
library(htmltools)
head(params$barplot_table)
```
Dashboard
=======================================================================
Inputs {.sidebar}
-----------------------------------------------------------------------
### Inputs
```{r}
sd_barplot_table <- SharedData$new(params$barplot_table)
sd_volcano_table <- SharedData$new(params$volcano_table)
filter_slider("value", "Value", sd_barplot_table, column=~Value, step=1000)
```
Column {.tabset}
-----------------------------------------------------------------------
### Barplot
```{r}
bar <- ggplot(sd_barplot_table, mapping=aes(x=Feature, y=Value, fill=Type)) +
geom_bar(stat="identity", position = "dodge")
bar_ly <- ggplotly(bar)
bscols(bar_ly,device = c("xs", "sm", "md", "lg"))
```
### Volcanoplot
```{r}
volcano <- ggplot(params$volcano_table,
mapping=aes(x=.data[['log2(FC)']],
y=.data[['-log10(pvalue)']],
color=.data[['Statistic']],
label=.data[['Feature']])) +
geom_vline(xintercept = 0,
size=0.5) +
geom_hline(yintercept = 0,
size=0.5) +
geom_point() +
geom_label()
volcano_y <- ggplotly(volcano)
volcano_y
```
### Table
```{r}
DT::datatable(params$barplot_table,
options = list(bPaginate = FALSE))
```
### Summary
```{r}
summary(params$barplot_table)
```